#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

void check_params(int ac, char **av);
void usage(const char *program);

int main(int argnc, char **argv)
{
  int fd, l, w, r;
  check_params(argc, argv);
  char *fpath = argv[1];
  fd = open(fpath, O_RDONLY | O_CREAT, S_IRWXU);

  if(fd == -1){
      perror(NULL);
      exit(1);
  }

  printf("Va bien\n");

  return 0;
}

void check_params(int ac, char **av)
{
  if(ac != 2){
    usage();
    exit(1);
  }
}

void usage(const char *program)
{
  char mesg[] = "";
  write();
}
